Optimal. Leaf size=266 \[ -\frac {a^2 \sin (c+d x) \cos ^3(c+d x)}{b d \left (a^2-b^2\right ) (a+b \cos (c+d x))}+\frac {\left (4 a^2-b^2\right ) \sin (c+d x) \cos ^2(c+d x)}{3 b^2 d \left (a^2-b^2\right )}-\frac {a x \left (4 a^2+b^2\right )}{b^5}-\frac {a \left (2 a^2-b^2\right ) \sin (c+d x) \cos (c+d x)}{b^3 d \left (a^2-b^2\right )}+\frac {2 a^4 \left (4 a^2-5 b^2\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^5 d (a-b)^{3/2} (a+b)^{3/2}}+\frac {\left (12 a^4-7 a^2 b^2-2 b^4\right ) \sin (c+d x)}{3 b^4 d \left (a^2-b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.72, antiderivative size = 266, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2792, 3049, 3023, 2735, 2659, 205} \[ \frac {\left (-7 a^2 b^2+12 a^4-2 b^4\right ) \sin (c+d x)}{3 b^4 d \left (a^2-b^2\right )}+\frac {2 a^4 \left (4 a^2-5 b^2\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^5 d (a-b)^{3/2} (a+b)^{3/2}}-\frac {a^2 \sin (c+d x) \cos ^3(c+d x)}{b d \left (a^2-b^2\right ) (a+b \cos (c+d x))}+\frac {\left (4 a^2-b^2\right ) \sin (c+d x) \cos ^2(c+d x)}{3 b^2 d \left (a^2-b^2\right )}-\frac {a \left (2 a^2-b^2\right ) \sin (c+d x) \cos (c+d x)}{b^3 d \left (a^2-b^2\right )}-\frac {a x \left (4 a^2+b^2\right )}{b^5} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 2659
Rule 2735
Rule 2792
Rule 3023
Rule 3049
Rubi steps
\begin {align*} \int \frac {\cos ^5(c+d x)}{(a+b \cos (c+d x))^2} \, dx &=-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac {\int \frac {\cos ^2(c+d x) \left (3 a^2-a b \cos (c+d x)-\left (4 a^2-b^2\right ) \cos ^2(c+d x)\right )}{a+b \cos (c+d x)} \, dx}{b \left (a^2-b^2\right )}\\ &=\frac {\left (4 a^2-b^2\right ) \cos ^2(c+d x) \sin (c+d x)}{3 b^2 \left (a^2-b^2\right ) d}-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac {\int \frac {\cos (c+d x) \left (-2 a \left (4 a^2-b^2\right )+b \left (a^2+2 b^2\right ) \cos (c+d x)+6 a \left (2 a^2-b^2\right ) \cos ^2(c+d x)\right )}{a+b \cos (c+d x)} \, dx}{3 b^2 \left (a^2-b^2\right )}\\ &=-\frac {a \left (2 a^2-b^2\right ) \cos (c+d x) \sin (c+d x)}{b^3 \left (a^2-b^2\right ) d}+\frac {\left (4 a^2-b^2\right ) \cos ^2(c+d x) \sin (c+d x)}{3 b^2 \left (a^2-b^2\right ) d}-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac {\int \frac {6 a^2 \left (2 a^2-b^2\right )-2 a b \left (2 a^2+b^2\right ) \cos (c+d x)-2 \left (12 a^4-7 a^2 b^2-2 b^4\right ) \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{6 b^3 \left (a^2-b^2\right )}\\ &=\frac {\left (12 a^4-7 a^2 b^2-2 b^4\right ) \sin (c+d x)}{3 b^4 \left (a^2-b^2\right ) d}-\frac {a \left (2 a^2-b^2\right ) \cos (c+d x) \sin (c+d x)}{b^3 \left (a^2-b^2\right ) d}+\frac {\left (4 a^2-b^2\right ) \cos ^2(c+d x) \sin (c+d x)}{3 b^2 \left (a^2-b^2\right ) d}-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac {\int \frac {6 a^2 b \left (2 a^2-b^2\right )+6 a \left (a^2-b^2\right ) \left (4 a^2+b^2\right ) \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{6 b^4 \left (a^2-b^2\right )}\\ &=-\frac {a \left (4 a^2+b^2\right ) x}{b^5}+\frac {\left (12 a^4-7 a^2 b^2-2 b^4\right ) \sin (c+d x)}{3 b^4 \left (a^2-b^2\right ) d}-\frac {a \left (2 a^2-b^2\right ) \cos (c+d x) \sin (c+d x)}{b^3 \left (a^2-b^2\right ) d}+\frac {\left (4 a^2-b^2\right ) \cos ^2(c+d x) \sin (c+d x)}{3 b^2 \left (a^2-b^2\right ) d}-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {\left (a^4 \left (4 a^2-5 b^2\right )\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{b^5 \left (a^2-b^2\right )}\\ &=-\frac {a \left (4 a^2+b^2\right ) x}{b^5}+\frac {\left (12 a^4-7 a^2 b^2-2 b^4\right ) \sin (c+d x)}{3 b^4 \left (a^2-b^2\right ) d}-\frac {a \left (2 a^2-b^2\right ) \cos (c+d x) \sin (c+d x)}{b^3 \left (a^2-b^2\right ) d}+\frac {\left (4 a^2-b^2\right ) \cos ^2(c+d x) \sin (c+d x)}{3 b^2 \left (a^2-b^2\right ) d}-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {\left (2 a^4 \left (4 a^2-5 b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^5 \left (a^2-b^2\right ) d}\\ &=-\frac {a \left (4 a^2+b^2\right ) x}{b^5}+\frac {2 a^4 \left (4 a^2-5 b^2\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} b^5 (a+b)^{3/2} d}+\frac {\left (12 a^4-7 a^2 b^2-2 b^4\right ) \sin (c+d x)}{3 b^4 \left (a^2-b^2\right ) d}-\frac {a \left (2 a^2-b^2\right ) \cos (c+d x) \sin (c+d x)}{b^3 \left (a^2-b^2\right ) d}+\frac {\left (4 a^2-b^2\right ) \cos ^2(c+d x) \sin (c+d x)}{3 b^2 \left (a^2-b^2\right ) d}-\frac {a^2 \cos ^3(c+d x) \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.90, size = 176, normalized size = 0.66 \[ \frac {\frac {12 a^5 b \sin (c+d x)}{(a-b) (a+b) (a+b \cos (c+d x))}+9 b \left (4 a^2+b^2\right ) \sin (c+d x)+\frac {24 a^4 \left (4 a^2-5 b^2\right ) \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )}{\left (b^2-a^2\right )^{3/2}}-6 a b^2 \sin (2 (c+d x))-12 a (2 a-i b) (2 a+i b) (c+d x)+b^3 \sin (3 (c+d x))}{12 b^5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.30, size = 747, normalized size = 2.81 \[ \left [-\frac {6 \, {\left (4 \, a^{7} b - 7 \, a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} d x \cos \left (d x + c\right ) + 6 \, {\left (4 \, a^{8} - 7 \, a^{6} b^{2} + 2 \, a^{4} b^{4} + a^{2} b^{6}\right )} d x + 3 \, {\left (4 \, a^{7} - 5 \, a^{5} b^{2} + {\left (4 \, a^{6} b - 5 \, a^{4} b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - 2 \, {\left (12 \, a^{7} b - 19 \, a^{5} b^{3} + 5 \, a^{3} b^{5} + 2 \, a b^{7} + {\left (a^{4} b^{4} - 2 \, a^{2} b^{6} + b^{8}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (a^{5} b^{3} - 2 \, a^{3} b^{5} + a b^{7}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (3 \, a^{6} b^{2} - 5 \, a^{4} b^{4} + a^{2} b^{6} + b^{8}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left ({\left (a^{4} b^{6} - 2 \, a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right ) + {\left (a^{5} b^{5} - 2 \, a^{3} b^{7} + a b^{9}\right )} d\right )}}, -\frac {3 \, {\left (4 \, a^{7} b - 7 \, a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} d x \cos \left (d x + c\right ) + 3 \, {\left (4 \, a^{8} - 7 \, a^{6} b^{2} + 2 \, a^{4} b^{4} + a^{2} b^{6}\right )} d x - 3 \, {\left (4 \, a^{7} - 5 \, a^{5} b^{2} + {\left (4 \, a^{6} b - 5 \, a^{4} b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (12 \, a^{7} b - 19 \, a^{5} b^{3} + 5 \, a^{3} b^{5} + 2 \, a b^{7} + {\left (a^{4} b^{4} - 2 \, a^{2} b^{6} + b^{8}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (a^{5} b^{3} - 2 \, a^{3} b^{5} + a b^{7}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (3 \, a^{6} b^{2} - 5 \, a^{4} b^{4} + a^{2} b^{6} + b^{8}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left ({\left (a^{4} b^{6} - 2 \, a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right ) + {\left (a^{5} b^{5} - 2 \, a^{3} b^{7} + a b^{9}\right )} d\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.93, size = 333, normalized size = 1.25 \[ \frac {\frac {6 \, a^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{2} b^{4} - b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )}} - \frac {6 \, {\left (4 \, a^{6} - 5 \, a^{4} b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{2} b^{5} - b^{7}\right )} \sqrt {a^{2} - b^{2}}} - \frac {3 \, {\left (4 \, a^{3} + a b^{2}\right )} {\left (d x + c\right )}}{b^{5}} + \frac {2 \, {\left (9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 18 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} b^{4}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 504, normalized size = 1.89 \[ \frac {2 a^{5} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,b^{4} \left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a +b \right )}+\frac {8 a^{6} \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \,b^{5} \left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {10 a^{4} \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \,b^{3} \left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {6 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}}{d \,b^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {2 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a}{d \,b^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {2 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {12 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}}{d \,b^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {4 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {6 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2}}{d \,b^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a}{d \,b^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-\frac {8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{3}}{d \,b^{5}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a}{d \,b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.21, size = 3852, normalized size = 14.48 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________